#coding=utf-8

from django.forms import ModelForm

from PublicTool.CzqForm import ShowModelForm
import models
__author__ = 'czq'
from django import forms
pwd_min_length=3
class UserRegisterForm(forms.Form):
    username=forms.CharField(max_length=15,label=u'用户名')
    email=forms.EmailField(required=True,label=u"邮箱")
    password1=forms.CharField(max_length=15,min_length=pwd_min_length, widget=forms.PasswordInput,label=u"密码")
    password2=forms.CharField(max_length=15,min_length=pwd_min_length, widget=forms.PasswordInput,label=u"确认密码")

class UserLoginForm(forms.Form):
    username=forms.CharField(max_length=15,label=u'用户名')
    password1=forms.CharField(max_length=15,min_length=pwd_min_length, widget=forms.PasswordInput,label=u"密码")

#用户信息
class UserProfileForm(ModelForm):
    class Meta:
        model=models.UserProfile
        fields=("nickName",'signature',)

class UserInfoForm(ModelForm):
    class Meta:
        model=models.UserInfo
        fields=("QQ","profession",'description',"hometown","location","sex","birthday","phone",)

class UserSettingForm(ModelForm):
    class Meta:
        model=models.UserSetting
        fields=("pageSize_Theme","pageSize_Reply",)

class UserManageForm(ModelForm):
    class Meta:
        model=models.UserProfile
        fields=("group",)



#组
class GroupForm(ShowModelForm):
    #def __init__(self, hidden_fields=[], readonly_fields=[], *args, **kwargs):
    #    #raise Exception,readonly_fields
    #    super(GroupForm,self).__init__(hidden_fields,readonly_fields, *args, **kwargs)
    class Meta:
        model=models.GroupProfile
        #readonly_fields = ('themeBusinessExtcreditMax',)